import Vue from "vue";
import App from "./App.vue";
import router from "./router";

Vue.config.productionTip = false;

// 配置elementUI
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

// 引入全局基础css
import "./assets/Css/bass.css";

// 配置vue-with-table-grid插件
import tableTree from 'vue-table-with-tree-grid'

Vue.component("table-tree", tableTree);


// 配置axios
import Axios from "axios";
Vue.prototype.$http = Axios;
Axios.defaults.baseURL = "https://www.liulongbin.top:8888/api/private/v1/";

// 请求拦截器
Axios.interceptors.request.use(
  function (config) {

    config.headers.Authorization = window.sessionStorage.getItem("token");
    return config;
  },
  function (error) {
    return Promise.reject(error);
  }
);

new Vue({
  router,
  render: h => h(App)
}).$mount("#app");
